package com.example.yiwei.crm.view.activity.JYCoordingActivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.view.activity.jtCustomer.CustomerJZSeacherActivity;

public class SeacherCustomerActivity extends AppCompatActivity {
    private EditText ed_name,ed_phone,ed_cphone,ed_yynumber;
    private ImageView back,comment;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_seacher_customer);
        ed_name = (EditText) findViewById(R.id.name);
        ed_phone = (EditText) findViewById(R.id.phone);
        ed_cphone = (EditText) findViewById(R.id.cphome);
        ed_yynumber = (EditText) findViewById(R.id.yy_number);
        back = (ImageView) findViewById(R.id.customer_jz_back);
        comment = (ImageView) findViewById(R.id.commit);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        comment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SeacherCustomerActivity.this,CustomerJZSeacherActivity.class);
                if (!ed_name.getText().toString().equals("")){
                    intent.putExtra("name",ed_name.getText().toString());
                }
                if (!ed_phone.getText().toString().equals("")){
                    intent.putExtra("phone",ed_phone.getText().toString());
                }
                if (!ed_cphone.getText().toString().equals("")){
                    intent.putExtra("cphone",ed_cphone.getText().toString());
                }
                if (!ed_yynumber.getText().toString().equals("")){
                    intent.putExtra("yynumber",ed_yynumber.getText().toString());
                }
                CustomerJZSeacherActivity.b.finish();
                finish();
                startActivity(intent);
            }
        });
    }
}
